home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / OrganicTreeCellRenderer.java < prev    next >
Text File  |  1998-06-30  |  3KB  |  80 lines

  1. /*
  2.  * @(#)OrganicTreeCellRenderer.java    1.4 98/02/02
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.swing.plaf.organic;
  22.  
  23. import com.sun.java.swing.*;
  24. import java.awt.*;
  25. import java.awt.event.*;
  26. import java.beans.*;
  27. import java.io.*;
  28. import java.util.*;
  29. import com.sun.java.swing.tree.*;
  30.  
  31. import com.sun.java.swing.plaf.basic.BasicTreeCellRenderer;
  32.  
  33. /**
  34.  * Organic renderer for a tree cell.
  35.  * <p>
  36.  * Warning: serialized objects of this class will not be compatible with
  37.  * future swing releases.  The current serialization support is appropriate
  38.  * for short term storage or RMI between Swing1.0 applications.  It will
  39.  * not be possible to load serialized Swing1.0 objects with future releases
  40.  * of Swing.  The JDK1.2 release of Swing will be the compatibility
  41.  * baseline for the serialized form of Swing objects.
  42.  *
  43.  * @version 1.4 02/02/98
  44.  * @author Steve Wilson
  45.  */
  46. public class OrganicTreeCellRenderer extends BasicTreeCellRenderer {
  47.  
  48.     private static boolean checkedForImages = false;
  49.     /**
  50.       * Returns a new instance of BasicTreeCellRenderer.  Alignment is
  51.       * set to left aligned.
  52.       */
  53.  /*   public OrganicTreeCellRenderer() {
  54.         System.out.println("made organic renderer");
  55.     setHorizontalAlignment(JLabel.LEFT);
  56.     if(!OrganicTreeCellRenderer.checkedForImages) {
  57.         try { 
  58.         BasicTreeCellRenderer.OpenIcon = LookAndFeel.makeIcon(
  59.                                       getClass(), "icons/TreeOpen.gif");
  60.         BasicTreeCellRenderer.ClosedIcon = LookAndFeel.makeIcon(
  61.                                       getClass(), "icons/TreeClosed.gif");
  62.         BasicTreeCellRenderer.LeafIcon = LookAndFeel.makeIcon(
  63.                                       getClass(), "icons/TreeLeaf.gif");
  64.         } catch (Exception e) {
  65.         System.out.println("Exception getting tree images " + e);
  66.         }
  67.         OrganicTreeCellRenderer.checkedForImages = true;
  68.     }
  69.     setLeafIcon(BasicTreeCellRenderer.LeafIcon);
  70.     setClosedIcon(BasicTreeCellRenderer.ClosedIcon);
  71.     setOpenIcon(BasicTreeCellRenderer.OpenIcon);
  72.     setForegroundSelectionColor(Color.white);
  73.     setForegroundNonSelectionColor(Color.black);
  74.     setBackgroundSelectionColor(Color.red);
  75.     }
  76.  
  77.  */
  78.  
  79. }
  80.